package cn.lili.controller.feign.order;

import cn.lili.modules.order.order.client.ReceiptClient;
import cn.lili.modules.order.order.entity.dos.Receipt;
import cn.lili.modules.order.order.service.ReceiptService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: ftyy
 * @date: 2022-01-13 18:03
 * @description: 发票实现类
 */
@RestController
@RequiredArgsConstructor
public class ReceiptFeignController implements ReceiptClient {

    private final ReceiptService receiptService;

    @Override
    public Receipt getByOrderSn(String orderSn) {
        return receiptService.getByOrderSn(orderSn);
    }

    @Override
    public Receipt getDetail(String id) {
        return receiptService.getDetail(id);
    }

    @Override
    public Receipt saveReceipt(Receipt receipt) {
        return receiptService.saveReceipt(receipt);
    }

    @Override
    public Receipt invoicing(String receiptId) {
        return receiptService.invoicing(receiptId);
    }

    @Override
    public boolean saveBatch(List<Receipt> receipts) {
        return receiptService.saveBatch(receipts);
    }
}
